package com.example.taximeter.bean;


import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * 权限信息
 */
public class Privilege {

    @NotNull(message = "权限id格式错误", groups =  GroupUpdate.class)
    private Integer privilegeid;

    @NotNull(message = "权限名称格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    @NotEmpty(message = "权限名称不能为空", groups = {GroupCreate.class, GroupUpdate.class})
    @Length(min = 0, max = 50, message = "权限名称格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private String privilegename;

    @NotNull(message = "权限id格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private Integer privilegeparent;

    @NotNull(message = "权限id格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private Integer leafnod;

    @Override
    public String toString() {
        return "Privilege{" +
                "privilegeid=" + privilegeid +
                ", privilegename='" + privilegename + '\'' +
                ", privilegeparent=" + privilegeparent +
                ", leafnod=" + leafnod +
                '}';
    }

    public Integer getPrivilegeid() {
        return privilegeid;
    }

    public void setPrivilegeid(Integer privilegeid) {
        this.privilegeid = privilegeid;
    }

    public String getPrivilegename() {
        return privilegename;
    }

    public void setPrivilegename(String privilegename) {
        this.privilegename = privilegename;
    }

    public Integer getPrivilegeparent() {
        return privilegeparent;
    }

    public void setPrivilegeparent(Integer privilegeparent) {
        this.privilegeparent = privilegeparent;
    }

    public Integer getLeafnod() {
        return leafnod;
    }

    public void setLeafnod(Integer leafnod) {
        this.leafnod = leafnod;
    }
}
